xen/vm-event: Fix interactions with the vcpu list
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 31 May 2019 19:29:27 +0000 (12:29 -0700)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 4 Jun 2019 13:43:51 +0000 (14:43 +0100)
commit928f59868c9a440c85e0f158dc75a4daffe4dceb
tree3c0f1fc07d813a30cd2581af74f619b88541a91d
parent27a94e914f316ee7f88006b24a1c05fd434f671b
xen/vm-event: Fix interactions with the vcpu list

vm_event_resume() should use domain_vcpu(), rather than opencoding it
without its Spectre v1 safety.

vm_event_wake_blocked() can't ever be invoked in a case where d->vcpu is
NULL, so drop the outer if() and reindent, fixing up style issues.

The comment, which is left alone, is false.  This algorithm still has
starvation issues when there is an asymetric rate of generated events.

However, the existing logic is sufficiently complicated and fragile that
I don't think I've followed it fully, and because we're trying to
obsolete this interface, the safest course of action is to leave it
alone, rather than to end up making things subtly different.

Therefore, no practical change that callers would notice.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
xen/common/vm_event.c